import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const rolePermissionConfiguration = r => require.ensure([], () => r(require('@/page/rolePermissionConfiguration')), 'rolePermissionConfiguration');
const aslogs = r => require.ensure([], () => r(require('@/page/aslogs')), 'aslogs');
const editPortal = r => require.ensure([], () => r(require('@/page/editPortal')), 'editPortal');
const lookPortal = r => require.ensure([], () => r(require('@/page/lookPortal')), 'lookPortal');
const portalList = r => require.ensure([], () => r(require('@/page/portalList')), 'portalList');
const accountdetail = r => require.ensure([], () => r(require('@/page/accountdetail')), 'accountdetail');
const updatepwd = r => require.ensure([], () => r(require('@/page/updatepwd')), 'updatepwd');
const login = r => require.ensure([], () => r(require('@/page/login')), 'login');
const manage = r => require.ensure([], () => r(require('@/page/manage')), 'manage');
const home = r => require.ensure([], () => r(require('@/page/home')), 'home');
const addascustoms = r => require.ensure([], () => r(require('@/page/addascustoms')), 'addascustoms');
const updateascustoms = r => require.ensure([], () => r(require('@/page/updateascustoms')), 'updateascustoms');
const ascustomsList = r => require.ensure([], () => r(require('@/page/ascustomsList')), 'ascustomsList');
const AsKeywordsList = r => require.ensure([], () => r(require('@/page/AsKeywordsList')), 'AsKeywordsList');
const users = r => require.ensure([], () => r(require('@/page/users')), 'users');
const adminList = r => require.ensure([], () => r(require('@/page/adminList')), 'adminList');
const finance = r => require.ensure([], () => r(require('@/page/finance')), 'finance');
const AsKeyInit = r => require.ensure([], () => r(require('@/page/AsKeyInit')), 'AsKeyInit');
const roles = r => require.ensure([], () => r(require('@/page/roles')), 'roles');
const financialManagement = r => require.ensure([], () => r(require('@/page/financialManagement')),'financialManagement');
const serviceType = r => require.ensure([], () => r(require('@/page/serviceType')), 'serviceType');
const lengthOfService = r => require.ensure([], () => r(require('@/page/lengthOfService')), 'lengthOfService');
const appAddress = r => require.ensure([], () => r(require('@/page/appAddress')), 'appAddress');
const customerType = r => require.ensure([], () => r(require('@/page/customerType')), 'customerType');
const certificateType = r => require.ensure([], () => r(require('@/page/certificateType')), 'certificateType');
const preferentialType = r => require.ensure([], () => r(require('@/page/preferentialType')), 'preferentialType');
const statementManage = r => require.ensure([], () => r(require('@/page/statementManage')), 'statementManage');
const audit = r => require.ensure([], () => r(require('@/page/audit')), 'audit');
const routes = [{
	path: '/',
	component: login
},
{
	path: '/manage',
	component: manage,
	name: '',
	children: [{
		path: '',
		component: home,
		meta: [],
	}, {
		path: '/accountdetail',
		component: accountdetail,
		meta: ['用户管理', '查看账户明细']
	}, {
		path: '/roles',
		component: roles,
		meta: ['系统管理', '角色管理']
	}, {
		path: '/rolePermissionConfiguration',
		component: rolePermissionConfiguration,
		meta: ['系统管理', '角色权限配置']
	},{
		path: '/audit',
		component: audit,
		meta: ['系统管理', '关键字审核']
	}, {
		path: '/updatepwd',
		component: updatepwd,
		meta: ['用户管理', '修改密码']
	}, {
		path: '/addascustoms',
		component: addascustoms,
		meta: ['代理商管理', '添加代理商'],
	}, {

		path: '/updateascustoms',
		component: updateascustoms,
		meta: ['代理商管理', '修改代理商'],
	}, {
		path: '/users',
		component: users,
		meta: ['系统管理', '用户管理'],
	}, {
		path: '/ascustomsList',
		component: ascustomsList,
		meta: ['代理商管理', '代理商列表'],
	},  {
		path: '/AsKeywordsList',
		component: AsKeywordsList,
		meta: ['代理商管理', '关键字管理'],
	}, {
		path: '/adminList',
		component: adminList,
		meta: ['数据管理', '管理员列表'],
	}, {
		path: '/aslogs',
		component: aslogs,
		meta: ['代理商管理', '操作日志'],
	}, {
		path: '/finance',
		component: finance,
		meta: ['系统管理', '财务管理'],
	}, {
		path: '/portalList',
		component: portalList,
		meta: ['门户管理', '门户列表'],
	}, {
		path: '/lookPortal',
		component: lookPortal,
		meta: ['门户管理', '查看门户'],
	}, {
		path: '/editPortal',
		component: editPortal,
		meta: ['门户管理', '修改门户'],
	}, {
		path: '/AsKeyInit',
		component: AsKeyInit,
		meta: ['设置', '管理员设置'],
	},
	{
		path: '/financialManagement',
		component: financialManagement,
		meta: ['系统配置管理', '财务管理'],
	},
	{
		path: '/serviceType',
		component: serviceType,
		meta: ['系统配置管理', '服务类型'],
	},
	{
		path: '/lengthOfService',
		component: lengthOfService,
		meta: ['系统配置管理', '服务年限'],
	},
	{
		path: '/appAddress',
		component: appAddress,
		meta: ['系统配置管理', 'APP地址'],
	},
	{
		path: '/customerType',
		component: customerType,
		meta: ['系统配置管理', '客户类型'],
	},
	{
		path: '/certificateType',
		component: certificateType,
		meta: ['系统配置管理', '证件类型'],
	},
	{
		path: '/preferentialType',
		component: preferentialType,
		meta: ['系统配置管理', '优惠类型'],
	},
	{
		path: '/statementManage',
		component: statementManage,
		meta: ['报表管理', '报表管理'],
	}
	]
}
]

export default new Router({
	routes,
	strict: process.env.NODE_ENV !== 'production',
})
